//菜单：账号操作容器
import PropTypes from 'prop-types';
import React from 'react';
import {connect} from 'react-redux';

import AccountNavComponent from '../components/menu-bar/account-nav.jsx';

const AccountNav = function (props) {
    const {
        ...componentProps
    } = props;

    return (
        <AccountNavComponent
            {...componentProps}
        />
    );
};

AccountNav.propTypes = {
    avatar: PropTypes.string,//头像
    nickname: PropTypes.string,//昵称
};

const mapStateToProps = state => ({
    avatar: state.session.avatar ? state.session.avatar : null,
    nickname: state.session.nickname ? state.session.nickname : '',
});

const mapDispatchToProps = () => ({});

export default connect(
    mapStateToProps,
    mapDispatchToProps
)(AccountNav);
// export default injectIntl(connect(
//     mapStateToProps,
//     mapDispatchToProps
// )(AccountNav));
